# -*- mode: python ; coding: utf-8 -*-

block_cipher = None

a = Analysis(
    ['main.py'],
    pathex=['/Users/wangxiaoyu/codeProjects/ai_molly_notes'],
    binaries=[],
    datas=[
        ('config.json', '.'),
        ('logging_config.json', '.'),
        ('AIMollyNotes.ico', '.')  # 注意这里改成.ico
    ],
    hiddenimports=[],
    hookspath=[],
    hooksconfig={},
    runtime_hooks=[],
    excludes=[],
    win_no_prefer_redirects=False,
    win_private_assemblies=False,
    cipher=block_cipher,
    noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)

exe = EXE(
    pyz,
    a.scripts,
    [],
    exclude_binaries=True,
    name='AIMollyNotes',
    debug=True,    # 改为True以显示调试信息
    bootloader_ignore_signals=False,
    strip=False,
    upx=True,
    console=True,  # 临时改为True以查看错误信息
    icon='AIMollyNotes.ico'
)

# 添加COLLECT和BUNDLE
coll = COLLECT(
    exe,
    a.binaries,
    a.zipfiles,
    a.datas,
    strip=False,
    upx=True,
    upx_exclude=[],
    name='AIMollyNotes'
)

app = BUNDLE(
    coll,
    name='AIMollyNotes.app',
    icon='AIMollyNotes.ico',
    bundle_identifier='com.aimollynotes.app',
    info_plist={
        'CFBundleShortVersionString': '1.0.0',
        'LSMinimumSystemVersion': '10.13.0',
        'NSHighResolutionCapable': True,
        'NSRequiresAquaSystemAppearance': False,  # 添加这行
        'LSBackgroundOnly': False,  # 添加这行
        'NSSupportsAutomaticGraphicsSwitching': True  # 添加这行
    }
)